package com.ilop.siteraudio.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.ilop.siteraudio.data.bean.ReportBean;
import com.ilop.siteraudio.data.bean.EmailBean;
import com.ilop.siteraudio.data.bean.RecordBean;

import com.ilop.siteraudio.greendao.ReportBeanDao;
import com.ilop.siteraudio.greendao.EmailBeanDao;
import com.ilop.siteraudio.greendao.RecordBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig reportBeanDaoConfig;
    private final DaoConfig emailBeanDaoConfig;
    private final DaoConfig recordBeanDaoConfig;

    private final ReportBeanDao reportBeanDao;
    private final EmailBeanDao emailBeanDao;
    private final RecordBeanDao recordBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        reportBeanDaoConfig = daoConfigMap.get(ReportBeanDao.class).clone();
        reportBeanDaoConfig.initIdentityScope(type);

        emailBeanDaoConfig = daoConfigMap.get(EmailBeanDao.class).clone();
        emailBeanDaoConfig.initIdentityScope(type);

        recordBeanDaoConfig = daoConfigMap.get(RecordBeanDao.class).clone();
        recordBeanDaoConfig.initIdentityScope(type);

        reportBeanDao = new ReportBeanDao(reportBeanDaoConfig, this);
        emailBeanDao = new EmailBeanDao(emailBeanDaoConfig, this);
        recordBeanDao = new RecordBeanDao(recordBeanDaoConfig, this);

        registerDao(ReportBean.class, reportBeanDao);
        registerDao(EmailBean.class, emailBeanDao);
        registerDao(RecordBean.class, recordBeanDao);
    }
    
    public void clear() {
        reportBeanDaoConfig.clearIdentityScope();
        emailBeanDaoConfig.clearIdentityScope();
        recordBeanDaoConfig.clearIdentityScope();
    }

    public ReportBeanDao getReportBeanDao() {
        return reportBeanDao;
    }

    public EmailBeanDao getEmailBeanDao() {
        return emailBeanDao;
    }

    public RecordBeanDao getRecordBeanDao() {
        return recordBeanDao;
    }

}
